Move garmin icon tables into their own file; make mapsource use that extern
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 26 Aug 2004 21:59:27 +0000 (21:59 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 26 Aug 2004 21:59:27 +0000 (21:59 +0000)
version.

Makefile: regenerate dependencies.

gpsbabel/Makefile
gpsbabel/garmin_tables.c [new file with mode: 0644]
gpsbabel/garmin_tables.h
gpsbabel/mapsource.c

index 0f92abed10893eb4e8049ad9fa1647aedc1c3cf6..33a665e13a82b666491d4d436d1723a005883463 100644 (file)
@@ -14,7 +14,7 @@ DEBUGGING=-g $(EXTRA_DEBUGGING)
 CFLAGS=$(EXTRA_CFLAGS) $(DEBUGGING) -Icoldsync $(INHIBIT_EXPAT) $(OPTIMIZATION)
 INSTALL_TARGETDIR=/usr/local/
 
-FMTS=magproto.o gpx.o geo.o mapsend.o mapsource.o \
+FMTS=magproto.o gpx.o geo.o mapsend.o mapsource.o garmin_tables.o \
        gpsutil.o pcx.o cetus.o copilot.o gpspilot.o magnav.o \
        psp.o holux.o garmin.o tmpro.o tpg.o \
        xcsv.o gcdb.o tiger.o internal_styles.o easygps.o quovadis.o \
@@ -111,7 +111,7 @@ mac-release:
 arcdist.o: arcdist.c defs.h queue.h grtcirc.h
 cetus.o: cetus.c defs.h queue.h coldsync/palm.h coldsync/pdb.h
 copilot.o: copilot.c defs.h queue.h coldsync/palm.h coldsync/pdb.h
-csv_util.o: csv_util.c defs.h queue.h csv_util.h
+csv_util.o: csv_util.c defs.h queue.h csv_util.h grtcirc.h
 delgpl.o: delgpl.c defs.h queue.h
 duplicate.o: duplicate.c defs.h queue.h
 easygps.o: easygps.c defs.h queue.h
@@ -122,15 +122,18 @@ garmin.o: garmin.c defs.h queue.h jeeps/gps.h jeeps/gpsport.h \
   jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h jeeps/gpsrqst.h \
   jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h \
   garmin_tables.h
+garmin_tables.o: garmin_tables.c garmin_tables.h
 gcdb.o: gcdb.c defs.h queue.h coldsync/palm.h coldsync/pdb.h
 geo.o: geo.c defs.h queue.h
 geoniche.o: geoniche.c defs.h queue.h coldsync/palm.h coldsync/pdb.h
-gpilots.o: gpilots.c defs.h queue.h coldsync/palm.h coldsync/pdb.h
+gpilots.o: gpilots.c defs.h queue.h coldsync/palm.h coldsync/pdb.h \
+  garmin_tables.h
 gpspilot.o: gpspilot.c defs.h queue.h coldsync/palm.h coldsync/pdb.h
 gpsutil.o: gpsutil.c defs.h queue.h magellan.h
 gpx.o: gpx.c defs.h queue.h
 grtcirc.o: grtcirc.c defs.h queue.h
 holux.o: holux.c defs.h queue.h holux.h
+hsa_ndv.o: hsa_ndv.c defs.h queue.h
 html.o: html.c defs.h queue.h jeeps/gpsmath.h jeeps/gps.h jeeps/gpsport.h \
   jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \
   jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \
@@ -144,6 +147,7 @@ mapsend.o: mapsend.c defs.h queue.h mapsend.h magellan.h
 mapsource.o: mapsource.c defs.h queue.h garmin_tables.h
 mkshort.o: mkshort.c defs.h queue.h
 navicache.o: navicache.c defs.h queue.h
+netstumbler.o: netstumbler.c defs.h queue.h csv_util.h
 nmea.o: nmea.c defs.h queue.h
 ozi.o: ozi.c defs.h queue.h csv_util.h
 palmdoc.o: palmdoc.c defs.h queue.h jeeps/gpsmath.h jeeps/gps.h \
@@ -164,6 +168,7 @@ reverse_route.o: reverse_route.c defs.h queue.h
 route.o: route.c defs.h queue.h
 saroute.o: saroute.c defs.h queue.h
 smplrout.o: smplrout.c defs.h queue.h grtcirc.h
+sort.o: sort.c defs.h queue.h
 text.o: text.c defs.h queue.h jeeps/gpsmath.h jeeps/gps.h jeeps/gpsport.h \
   jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \
   jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \
@@ -177,6 +182,7 @@ tpg.o: tpg.c defs.h queue.h jeeps/gpsmath.h jeeps/gps.h jeeps/gpsport.h \
   jeeps/gpsnmea.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsinput.h \
   jeeps/gpsproj.h jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h
 util.o: util.c defs.h queue.h
+util_crc.o: util_crc.c
 vecs.o: vecs.c defs.h queue.h csv_util.h
 vmem.o: vmem.c defs.h queue.h
 waypt.o: waypt.c defs.h queue.h
@@ -243,4 +249,4 @@ jeeps/gpsutil.o: jeeps/gpsutil.c jeeps/gps.h defs.h queue.h \
   jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \
   jeeps/gpsnmeaget.h
 internal_styles.c: mkstyle.sh style/README.style style/arc.style style/csv.style style/custom.style style/dna.style style/fugawi.style style/gpsdrive.style style/gpsman.style style/mapconverter.style style/mxf.style style/nima.style style/s_and_t.style style/saplus.style style/tabsep.style style/xmap.style style/xmapwpt.style
-       ./mkstyle.sh > internal_styles.c || (rm -f dep ; exit 1)
+       ./mkstyle.sh > internal_styles.c || (rm -f internal_styles.c ; exit 1)
diff --git a/gpsbabel/garmin_tables.c b/gpsbabel/garmin_tables.c
new file mode 100644 (file)
index 0000000..a96681c
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+    Garmin icon tables
+    Based on information provided by Ian Cowley, Sigurd Humerfelt,
+       and Garmin MapSource
+
+    Copyright (C) 2003 Robert Lipe, robertlipe@usa.net
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+ */
+
+#include "garmin_tables.h"
+#include <stdio.h>
+
+/* MapSource 4.13 */
+icon_mapping_t garmin_icon_table[] = {
+/*       mps    pcx    desc */
+       {   107, 16384, "Airport" },
+       {    73,  8204, "Amusement Park" },
+       {    55,   169, "Ball Park" },
+       {     6,     6, "Bank" },
+       {    13,    13, "Bar" },
+       {   104,  8244, "Beach" },
+       {     1,     1, "Bell" },
+       {    37,   150, "Boat Ramp" },
+       {    74,  8205, "Bowling" },
+       {    93,  8233, "Bridge" },
+       {    94,  8234, "Building" },
+       {    38,   151, "Campground" },
+       {    56,   170, "Car" },
+       {    75,  8206, "Car Rental" },
+       {    76,  8207, "Car Repair" },
+       {    95,  8235, "Cemetery" },
+       {    96,  8236, "Church" },
+       {    65,   179, "Circle with X" },
+       {    72,  8203, "City (Capitol)" },
+       {    71,  8200, "City (Large)" },
+       {    70,  8199, "City (Medium)" },
+       {    69,  8198, "City (Small)" },
+       {    97,  8237, "Civil" },
+       {   119,  8262, "Contact, Afro" },
+       {   120,  8272, "Contact, Alien" },
+       {   121,  8258, "Contact, Ball Cap" },
+       {   122,  8259, "Contact, Big Ears" },
+       {   123,  8271, "Contact, Biker" },
+       {   124,  8273, "Contact, Bug" },
+       {   125,  8274, "Contact, Cat" },
+       {   126,  8275, "Contact, Dog" },
+       {   127,  8263, "Contact, Dreadlocks" },
+       {   128,  8264, "Contact, Female1" },
+       {   129,  8265, "Contact, Female2" },
+       {   130,  8266, "Contact, Female3" },
+       {   131,  8261, "Contact, Goatee" },
+       {   132,  8268, "Contact, Kung-Fu" },
+       {   133,  8276, "Contact, Pig" },
+       {   134,  8270, "Contact, Pirate" },
+       {   135,  8267, "Contact, Ranger" },
+       {   136,  8257, "Contact, Smiley" },
+       {   137,  8260, "Contact, Spike" },
+       {   138,  8269, "Contact, Sumo" },
+       {    52,   165, "Controlled Area" },
+       {    89,  8220, "Convenience Store" },
+       {    98,  8238, "Crossing" },
+       {    51,   164, "Dam" },
+       {    53,   166, "Danger Area" },
+       {    87,  8218, "Department Store" },
+       {     4,     4, "Diver Down Flag 1" },
+       {     5,     5, "Diver Down Flag 2" },
+       {    41,   154, "Drinking Water" },
+       {    63,   177, "Exit" },
+       {    77,  8208, "Fast Food" },
+       {     7,     7, "Fishing Area" },
+       {    78,  8209, "Fitness Center" },
+       {    64,   178, "Flag" },
+       {   105,  8245, "Forest" },
+       {     8,     8, "Gas Station" },
+       {   117,  8255, "Geocache" },
+       {   118,  8256, "Geocache Found" },
+       {    99,  8239, "Ghost Town" },
+       {   113, 16393, "Glider Area" },
+       {    68,  8197, "Golf Course" },
+       {     2,     2, "Green Diamond" },
+       {    15,    15, "Green Square" },
+       {   108, 16388, "Heliport" },
+       {     9,     9, "Horn" },
+       {    57,   171, "Hunting Area" },
+       {    44,   157, "Information" },
+       {   100,  8240, "Levee" },
+       {    12,    12, "Light" },
+       {    90,  8221, "Live Theater" },
+       {    59,   173, "Lodging" },
+       {    20,    21, "Man Overboard" },
+       {     0,     0, "Marina" },
+       {    43,   156, "Medical Facility" },
+       {    66,  8195, "Mile Marker" },
+       {   101,  8241, "Military" },
+       {    60,   174, "Mine" },
+       {    79,  8210, "Movie Theater" },
+       {    80,  8211, "Museum" },
+       {    21,    22, "Navaid, Amber" },
+       {    22,    23, "Navaid, Black" },
+       {    23,    24, "Navaid, Blue" },
+       {    24,    25, "Navaid, Green" },
+       {    25,    26, "Navaid, Green/Red" },
+       {    26,    27, "Navaid, Green/White" },
+       {    27,    28, "Navaid, Orange" },
+       {    28,    29, "Navaid, Red" },
+       {    29,    30, "Navaid, Red/Green" },
+       {    30,    31, "Navaid, Red/White" },
+       {    31,    32, "Navaid, Violet" },
+       {    32,    33, "Navaid, White" },
+       {    33,    34, "Navaid, White/Green" },
+       {    34,    35, "Navaid, White/Red" },
+       {   102,  8242, "Oil Field" },
+       {   115, 16395, "Parachute Area" },
+       {    46,   159, "Park" },
+       {    45,   158, "Parking Area" },
+       {    81,  8212, "Pharmacy" },
+       {    47,   160, "Picnic Area" },
+       {    82,  8213, "Pizza" },
+       {    83,  8214, "Post Office" },
+       {   109, 16389, "Private Field" },
+       {    36,    37, "Radio Beacon" },
+       {     3,     3, "Red Diamond" },
+       {    16,    16, "Red Square" },
+       {    10,    10, "Residence" },
+       {    11,    11, "Restaurant" },
+       {    54,   167, "Restricted Area" },
+       {    39,   152, "Restroom" },
+       {    84,  8215, "RV Park" },
+       {    91,  8226, "Scales" },
+       {    48,   161, "Scenic Area" },
+       {    85,  8216, "School" },
+       {   116, 16402, "Seaplane Base" },
+       {    19,    19, "Shipwreck" },
+       {    58,   172, "Shopping Center" },
+       {   112, 16392, "Short Tower" },
+       {    40,   153, "Shower" },
+       {    49,   162, "Skiing Area" },
+       {    14,    14, "Skull and Crossbones" },
+       {   110, 16390, "Soft Field" },
+       {    86,  8217, "Stadium" },
+       {   106,  8246, "Summit" },
+       {    50,   163, "Swimming Area" },
+       {   111, 16391, "Tall Tower" },
+       {    42,   155, "Telephone" },
+       {    92,  8227, "Toll Booth" },
+       {    67,  8196, "TracBack Point" },
+       {    61,   175, "Trail Head" },
+       {    62,   176, "Truck Stop" },
+       {   103,  8243, "Tunnel" },
+       {   114, 16394, "Ultralight Area" },
+       {   139,  8282, "Water Hydrant" },      /* new in MapSource V5 */
+       {    18,    18, "Waypoint" },
+       {    17,    17, "White Buoy" },
+       {    35,    36, "White Dot" },
+       {    88,  8219, "Zoo" },
+       {    92,  8227, "Micro-Cache" },        /* icon for "Toll Booth" */
+       {    48,   161, "Virtual cache" },      /* icon for "Scenic Area" */
+       {    86,  8217, "Multi-Cache" },        /* icon for "Stadium" */
+       {    44,   157, "Unknown Cache" },      /* icon for "Information" */
+       {    64,   178, "Locationless (Reverse) Cache" }, /* Icon for "Flag" */
+       {    83,  8214, "Post Office" },        /* Icon for "Post Office" */
+       {    47,   160, "Event Cache" },        /* Icon for "Event" */
+       {    90,  8221, "Webcam Cache" },       /* Icon for "Live Theatre" */
+
+       {    -1,    -1, NULL },
+};
index dc5b5ff5f783275364cc27d6f191414945fed3ed..9b58383cbd9328aa3c7a480f2a4212e62005efdc 100644 (file)
@@ -35,157 +35,4 @@ extern int
 mps_find_icon_number_from_desc(const char *desc, 
        garmin_formats_e garmin_format);
 
-/* MapSource 4.13 */
-static icon_mapping_t icon_table[] = {
-/*       mps    pcx    desc */
-       {   107, 16384, "Airport" },
-       {    73,  8204, "Amusement Park" },
-       {    55,   169, "Ball Park" },
-       {     6,     6, "Bank" },
-       {    13,    13, "Bar" },
-       {   104,  8244, "Beach" },
-       {     1,     1, "Bell" },
-       {    37,   150, "Boat Ramp" },
-       {    74,  8205, "Bowling" },
-       {    93,  8233, "Bridge" },
-       {    94,  8234, "Building" },
-       {    38,   151, "Campground" },
-       {    56,   170, "Car" },
-       {    75,  8206, "Car Rental" },
-       {    76,  8207, "Car Repair" },
-       {    95,  8235, "Cemetery" },
-       {    96,  8236, "Church" },
-       {    65,   179, "Circle with X" },
-       {    72,  8203, "City (Capitol)" },
-       {    71,  8200, "City (Large)" },
-       {    70,  8199, "City (Medium)" },
-       {    69,  8198, "City (Small)" },
-       {    97,  8237, "Civil" },
-       {   119,  8262, "Contact, Afro" },
-       {   120,  8272, "Contact, Alien" },
-       {   121,  8258, "Contact, Ball Cap" },
-       {   122,  8259, "Contact, Big Ears" },
-       {   123,  8271, "Contact, Biker" },
-       {   124,  8273, "Contact, Bug" },
-       {   125,  8274, "Contact, Cat" },
-       {   126,  8275, "Contact, Dog" },
-       {   127,  8263, "Contact, Dreadlocks" },
-       {   128,  8264, "Contact, Female1" },
-       {   129,  8265, "Contact, Female2" },
-       {   130,  8266, "Contact, Female3" },
-       {   131,  8261, "Contact, Goatee" },
-       {   132,  8268, "Contact, Kung-Fu" },
-       {   133,  8276, "Contact, Pig" },
-       {   134,  8270, "Contact, Pirate" },
-       {   135,  8267, "Contact, Ranger" },
-       {   136,  8257, "Contact, Smiley" },
-       {   137,  8260, "Contact, Spike" },
-       {   138,  8269, "Contact, Sumo" },
-       {    52,   165, "Controlled Area" },
-       {    89,  8220, "Convenience Store" },
-       {    98,  8238, "Crossing" },
-       {    51,   164, "Dam" },
-       {    53,   166, "Danger Area" },
-       {    87,  8218, "Department Store" },
-       {     4,     4, "Diver Down Flag 1" },
-       {     5,     5, "Diver Down Flag 2" },
-       {    41,   154, "Drinking Water" },
-       {    63,   177, "Exit" },
-       {    77,  8208, "Fast Food" },
-       {     7,     7, "Fishing Area" },
-       {    78,  8209, "Fitness Center" },
-       {    64,   178, "Flag" },
-       {   105,  8245, "Forest" },
-       {     8,     8, "Gas Station" },
-       {   117,  8255, "Geocache" },
-       {   118,  8256, "Geocache Found" },
-       {    99,  8239, "Ghost Town" },
-       {   113, 16393, "Glider Area" },
-       {    68,  8197, "Golf Course" },
-       {     2,     2, "Green Diamond" },
-       {    15,    15, "Green Square" },
-       {   108, 16388, "Heliport" },
-       {     9,     9, "Horn" },
-       {    57,   171, "Hunting Area" },
-       {    44,   157, "Information" },
-       {   100,  8240, "Levee" },
-       {    12,    12, "Light" },
-       {    90,  8221, "Live Theater" },
-       {    59,   173, "Lodging" },
-       {    20,    21, "Man Overboard" },
-       {     0,     0, "Marina" },
-       {    43,   156, "Medical Facility" },
-       {    66,  8195, "Mile Marker" },
-       {   101,  8241, "Military" },
-       {    60,   174, "Mine" },
-       {    79,  8210, "Movie Theater" },
-       {    80,  8211, "Museum" },
-       {    21,    22, "Navaid, Amber" },
-       {    22,    23, "Navaid, Black" },
-       {    23,    24, "Navaid, Blue" },
-       {    24,    25, "Navaid, Green" },
-       {    25,    26, "Navaid, Green/Red" },
-       {    26,    27, "Navaid, Green/White" },
-       {    27,    28, "Navaid, Orange" },
-       {    28,    29, "Navaid, Red" },
-       {    29,    30, "Navaid, Red/Green" },
-       {    30,    31, "Navaid, Red/White" },
-       {    31,    32, "Navaid, Violet" },
-       {    32,    33, "Navaid, White" },
-       {    33,    34, "Navaid, White/Green" },
-       {    34,    35, "Navaid, White/Red" },
-       {   102,  8242, "Oil Field" },
-       {   115, 16395, "Parachute Area" },
-       {    46,   159, "Park" },
-       {    45,   158, "Parking Area" },
-       {    81,  8212, "Pharmacy" },
-       {    47,   160, "Picnic Area" },
-       {    82,  8213, "Pizza" },
-       {    83,  8214, "Post Office" },
-       {   109, 16389, "Private Field" },
-       {    36,    37, "Radio Beacon" },
-       {     3,     3, "Red Diamond" },
-       {    16,    16, "Red Square" },
-       {    10,    10, "Residence" },
-       {    11,    11, "Restaurant" },
-       {    54,   167, "Restricted Area" },
-       {    39,   152, "Restroom" },
-       {    84,  8215, "RV Park" },
-       {    91,  8226, "Scales" },
-       {    48,   161, "Scenic Area" },
-       {    85,  8216, "School" },
-       {   116, 16402, "Seaplane Base" },
-       {    19,    19, "Shipwreck" },
-       {    58,   172, "Shopping Center" },
-       {   112, 16392, "Short Tower" },
-       {    40,   153, "Shower" },
-       {    49,   162, "Skiing Area" },
-       {    14,    14, "Skull and Crossbones" },
-       {   110, 16390, "Soft Field" },
-       {    86,  8217, "Stadium" },
-       {   106,  8246, "Summit" },
-       {    50,   163, "Swimming Area" },
-       {   111, 16391, "Tall Tower" },
-       {    42,   155, "Telephone" },
-       {    92,  8227, "Toll Booth" },
-       {    67,  8196, "TracBack Point" },
-       {    61,   175, "Trail Head" },
-       {    62,   176, "Truck Stop" },
-       {   103,  8243, "Tunnel" },
-       {   114, 16394, "Ultralight Area" },
-       {   139,  8282, "Water Hydrant" },      /* new in MapSource V5 */
-       {    18,    18, "Waypoint" },
-       {    17,    17, "White Buoy" },
-       {    35,    36, "White Dot" },
-       {    88,  8219, "Zoo" },
-       {    92,  8227, "Micro-Cache" },        /* icon for "Toll Booth" */
-       {    48,   161, "Virtual cache" },      /* icon for "Scenic Area" */
-       {    86,  8217, "Multi-Cache" },        /* icon for "Stadium" */
-       {    44,   157, "Unknown Cache" },      /* icon for "Information" */
-       {    64,   178, "Locationless (Reverse) Cache" }, /* Icon for "Flag" */
-       {    83,  8214, "Post Office" },        /* Icon for "Post Office" */
-       {    47,   160, "Event Cache" },        /* Icon for "Event" */
-       {    90,  8221, "Webcam Cache" },       /* Icon for "Live Theatre" */
-
-       {    -1,    -1, NULL },
-};
+extern icon_mapping_t garmin_icon_table[];
index 3ffd5279854f9c2025fa8e924b5ad11a34ed650c..dcdb7a8b225b66adc1e7c17b310be2339dd42cd5 100644 (file)
@@ -160,7 +160,7 @@ mps_find_desc_from_icon_number(const int icon, garmin_formats_e garmin_format)
 {
        icon_mapping_t *i;
 
-       for (i = icon_table; i->icon; i++) {
+       for (i = garmin_icon_table; i->icon; i++) {
                switch (garmin_format) {
                        case MAPSOURCE:
                                if (icon == i->mpssymnum)
@@ -197,7 +197,7 @@ mps_find_icon_number_from_desc(const char *desc, garmin_formats_e garmin_format)
                return n;
        }
 
-       for (i = icon_table; i->icon; i++) {
+       for (i = garmin_icon_table; i->icon; i++) {
                if (case_ignore_strcmp(desc,i->icon) == 0) {
                        switch (garmin_format) {
                        case MAPSOURCE:
@@ -1732,7 +1732,7 @@ mps_read(void)
        mps_fileHeader_r(mps_file_in, &mps_ver_in);
 
 #ifdef DUMP_ICON_TABLE
-       printf("static icon_mapping_t icon_table[] = {\n");
+       printf("static icon_mapping_t garmin_icon_table[] = {\n");
 #endif
 
        morework = 1;